package com.Khan.SocialRescueSys.controller;

import com.Khan.SocialRescueSys.pojo.ProvinceForceCount;
import com.Khan.SocialRescueSys.service.ForceService;
import com.google.gson.Gson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author Khan Liu
 * @date 2022/3/30 21:13
 */
@Controller
public class IndexController {

    @Autowired
    private ForceService forceService;

    @RequestMapping("/")
    public String toIndex(Model model){
        List<ProvinceForceCount> provinceForceCount = forceService.getProvinceForceCount();
        model.addAttribute("provinceForceCount",provinceForceCount);
        return "index";
    }

}
